 Imports MySql.Data.MySqlClient 
 Imports System.Data.OleDb
Imports System.Data.SqlClient
 Imports System .Data .SqlServerCe 
 Imports System.Data.OracleClient 
Imports System.Data
Imports DTO
Public Class GIAOVIENDao
Inherits AbstractDao
 #Region "New" 
 Public Sub New(ByVal connection As KetNoiDto)
 MyBase.New(connection)
 End Sub
 Public Sub New( ByVal IDGIAOVIEN As System.Int32, ByVal connection As KetNoiDto)
 MyBase.New("GIAOVIEN", "select * from GIAOVIEN where IDGIAOVIEN=" & IDGIAOVIEN & "", connection)
 End Sub
 #End Region 
 Public Sub Them(ByVal Dto As GIAOVIENDto)
 Dim strsql As String
 strsql = "Insert into GIAOVIEN(MAGIAOVIEN,TENGIAOVIEN,GIOITINH,DIACHI,SDT,NGAYSINH,TRANGTHAI,GHICHU) values (?,?,?,?,?,?,?,?)
 Moketnoi()
 select case ketnoi.MSsql 
 Case Class_KieuDL.Access
 Dim cmd As New OleDbCommand(strsql, Ket_noi_access)
cmd.Parameters.Add("@MAGIAOVIEN", OleDbType.VarWChar)
cmd.Parameters.Add("@TENGIAOVIEN", OleDbType.VarWChar)
cmd.Parameters.Add("@GIOITINH", OleDbType.Integer)
cmd.Parameters.Add("@DIACHI", OleDbType.VarWChar)
cmd.Parameters.Add("@SDT", OleDbType.VarWChar)
cmd.Parameters.Add("@NGAYSINH", OleDbType.VarWChar)
cmd.Parameters.Add("@TRANGTHAI", OleDbType.Integer)
cmd.Parameters.Add("@GHICHU", OleDbType.VarWChar)
cmd.Parameters("@MAGIAOVIEN").Value = Dto.MAGIAOVIEN
cmd.Parameters("@TENGIAOVIEN").Value = Dto.TENGIAOVIEN
cmd.Parameters("@GIOITINH").Value = Dto.GIOITINH
cmd.Parameters("@DIACHI").Value = Dto.DIACHI
cmd.Parameters("@SDT").Value = Dto.SDT
cmd.Parameters("@NGAYSINH").Value = Dto.NGAYSINH
cmd.Parameters("@TRANGTHAI").Value = Dto.TRANGTHAI
cmd.Parameters("@GHICHU").Value = Dto.GHICHU
 cmd.ExecuteNonQuery()
 strsql = "Select @@IDENTITY"
 cmd = New OleDbCommand(strsql, Ket_noi_access)
 Dto.IDGIAOVIEN = cmd.ExecuteScalar()
 Case Class_KieuDL.Sql,Class_KieuDL.sqlExpress
 strsql = "Insert into GIAOVIEN(MAGIAOVIEN,TENGIAOVIEN,GIOITINH,DIACHI,SDT,NGAYSINH,TRANGTHAI,GHICHU) values (@MAGIAOVIEN,@TENGIAOVIEN,@GIOITINH,@DIACHI,@SDT,@NGAYSINH,@TRANGTHAI,@GHICHU)
 Dim cmd As New sqlCommand(strsql, Ket_noi_sql)
cmd.Parameters.Add("@MAGIAOVIEN", SqlDbType.NVarChar)
cmd.Parameters.Add("@TENGIAOVIEN", SqlDbType.NVarChar)
cmd.Parameters.Add("@GIOITINH", SqlDbType.Int)
cmd.Parameters.Add("@DIACHI", SqlDbType.NVarChar)
cmd.Parameters.Add("@SDT", SqlDbType.NVarChar)
cmd.Parameters.Add("@NGAYSINH", SqlDbType.NVarChar)
cmd.Parameters.Add("@TRANGTHAI", SqlDbType.Int)
cmd.Parameters.Add("@GHICHU", SqlDbType.NVarChar)
cmd.Parameters("@MAGIAOVIEN").Value = Dto.MAGIAOVIEN
cmd.Parameters("@TENGIAOVIEN").Value = Dto.TENGIAOVIEN
cmd.Parameters("@GIOITINH").Value = Dto.GIOITINH
cmd.Parameters("@DIACHI").Value = Dto.DIACHI
cmd.Parameters("@SDT").Value = Dto.SDT
cmd.Parameters("@NGAYSINH").Value = Dto.NGAYSINH
cmd.Parameters("@TRANGTHAI").Value = Dto.TRANGTHAI
cmd.Parameters("@GHICHU").Value = Dto.GHICHU
 cmd.ExecuteNonQuery()
 strsql = "Select @@IDENTITY"
 cmd = New sqlCommand(strsql, Ket_noi_sql)
 Dto.IDGIAOVIEN = cmd.ExecuteScalar()
 Case Class_KieuDL.SqlCe
 strsql = "Insert into GIAOVIEN(MAGIAOVIEN,TENGIAOVIEN,GIOITINH,DIACHI,SDT,NGAYSINH,TRANGTHAI,GHICHU) values (@MAGIAOVIEN,@TENGIAOVIEN,@GIOITINH,@DIACHI,@SDT,@NGAYSINH,@TRANGTHAI,@GHICHU)
 Dim cmd As New sqlceCommand(strsql, Ket_noi_SqlCe)
cmd.Parameters("@MAGIAOVIEN").Value = Dto.MAGIAOVIEN
cmd.Parameters("@TENGIAOVIEN").Value = Dto.TENGIAOVIEN
cmd.Parameters("@GIOITINH").Value = Dto.GIOITINH
cmd.Parameters("@DIACHI").Value = Dto.DIACHI
cmd.Parameters("@SDT").Value = Dto.SDT
cmd.Parameters("@NGAYSINH").Value = Dto.NGAYSINH
cmd.Parameters("@TRANGTHAI").Value = Dto.TRANGTHAI
cmd.Parameters("@GHICHU").Value = Dto.GHICHU
 cmd.ExecuteNonQuery()
 Case Class_KieuDL.Oracle
 strsql = "Insert into GIAOVIEN(MAGIAOVIEN,TENGIAOVIEN,GIOITINH,DIACHI,SDT,NGAYSINH,TRANGTHAI,GHICHU) values (@MAGIAOVIEN,@TENGIAOVIEN,@GIOITINH,@DIACHI,@SDT,@NGAYSINH,@TRANGTHAI,@GHICHU)
 Dim cmd As New OracleCommand(strsql, Ket_noi_Oracle)
cmd.Parameters("@MAGIAOVIEN").Value = Dto.MAGIAOVIEN
cmd.Parameters("@TENGIAOVIEN").Value = Dto.TENGIAOVIEN
cmd.Parameters("@GIOITINH").Value = Dto.GIOITINH
cmd.Parameters("@DIACHI").Value = Dto.DIACHI
cmd.Parameters("@SDT").Value = Dto.SDT
cmd.Parameters("@NGAYSINH").Value = Dto.NGAYSINH
cmd.Parameters("@TRANGTHAI").Value = Dto.TRANGTHAI
cmd.Parameters("@GHICHU").Value = Dto.GHICHU
 cmd.ExecuteNonQuery()
 Case Class_KieuDL.Mysql
 strsql = "Insert into GIAOVIEN(MAGIAOVIEN,TENGIAOVIEN,GIOITINH,DIACHI,SDT,NGAYSINH,TRANGTHAI,GHICHU) values (@MAGIAOVIEN,@TENGIAOVIEN,@GIOITINH,@DIACHI,@SDT,@NGAYSINH,@TRANGTHAI,@GHICHU)
 Dim cmd As New MySqlCommand(strsql, Ket_noi_MySql)
cmd.Parameters.Add("@MAGIAOVIEN", MySqlDbType.String)
cmd.Parameters.Add("@TENGIAOVIEN", MySqlDbType.String)
cmd.Parameters.Add("@GIOITINH", MySqlDbType.Int32)
cmd.Parameters.Add("@DIACHI", MySqlDbType.String)
cmd.Parameters.Add("@SDT", MySqlDbType.String)
cmd.Parameters.Add("@NGAYSINH", MySqlDbType.String)
cmd.Parameters.Add("@TRANGTHAI", MySqlDbType.Int32)
cmd.Parameters.Add("@GHICHU", MySqlDbType.String)
cmd.Parameters("@MAGIAOVIEN").Value = Dto.MAGIAOVIEN
cmd.Parameters("@TENGIAOVIEN").Value = Dto.TENGIAOVIEN
cmd.Parameters("@GIOITINH").Value = Dto.GIOITINH
cmd.Parameters("@DIACHI").Value = Dto.DIACHI
cmd.Parameters("@SDT").Value = Dto.SDT
cmd.Parameters("@NGAYSINH").Value = Dto.NGAYSINH
cmd.Parameters("@TRANGTHAI").Value = Dto.TRANGTHAI
cmd.Parameters("@GHICHU").Value = Dto.GHICHU
 cmd.ExecuteNonQuery()
 End Select
 Ngatketnoi()
 End Sub
 Public Sub Xoa( ByVal IDGIAOVIEN As System.Int32 )
 Dim strSQL As String
 Moketnoi()
 select case ketnoi.MSsql 
 Case Class_KieuDL.Access
strSQL = "Delete From GIAOVIEN Where IDGIAOVIEN= ? 
Dim cmd As New OleDbCommand(strSQL, Ket_noi_access)
cmd.Parameters.Add("@IDGIAOVIEN",OleDbType.Integer).Value = IDGIAOVIEN
 cmd.ExecuteNonQuery()
 Case Class_KieuDL.Sql,Class_KieuDL.sqlExpress 
strSQL = "Delete From GIAOVIEN Where IDGIAOVIEN= @IDGIAOVIEN
Dim cmd As New sqlCommand(strSQL, Ket_noi_sql)
cmd.Parameters.Add("@IDGIAOVIEN",SqlDbType.Int).value=IDGIAOVIEN
 cmd.ExecuteNonQuery()
 Case Class_KieuDL.SqlCe
strSQL = "Delete From GIAOVIEN Where IDGIAOVIEN=" & IDGIAOVIEN & "
 Dim cmd As New SqlCeCommand(strSQL, Ket_noi_SqlCe)
 cmd.ExecuteNonQuery()
 Case Class_KieuDL.Oracle
strSQL = "Delete From GIAOVIEN Where IDGIAOVIEN=" & IDGIAOVIEN & "
 Dim cmd As New OracleCommand(strSQL, Ket_noi_Oracle)
 cmd.ExecuteNonQuery()
 Case Class_KieuDL.MySql
strSQL = "Delete From GIAOVIEN Where IDGIAOVIEN=" & IDGIAOVIEN & "
 Dim cmd As New MySqlCommand(strSQL, Ket_noi_MySql)
 cmd.ExecuteNonQuery()
 End Select
 Ngatketnoi()
 End Sub
 Public Sub sua(ByVal dto As GIAOVIENDto)
 Dim strSQL As String
 Moketnoi()
 select case ketnoi.MSsql 
 Case Class_KieuDL.Access
 strSQL = "Update GIAOVIEN Set MAGIAOVIEN=? ,TENGIAOVIEN=? ,GIOITINH=? ,DIACHI=? ,SDT=? ,NGAYSINH=? ,TRANGTHAI=? ,GHICHU= ? where IDGIAOVIEN= ? "
 Dim cmd As New OleDbCommand(strSQL, Ket_noi_access)
cmd.Parameters.Add("@MAGIAOVIEN", OleDbType.VarWChar)
cmd.Parameters.Add("@TENGIAOVIEN", OleDbType.VarWChar)
cmd.Parameters.Add("@GIOITINH", OleDbType.Integer)
cmd.Parameters.Add("@DIACHI", OleDbType.VarWChar)
cmd.Parameters.Add("@SDT", OleDbType.VarWChar)
cmd.Parameters.Add("@NGAYSINH", OleDbType.VarWChar)
cmd.Parameters.Add("@TRANGTHAI", OleDbType.Integer)
cmd.Parameters.Add("@GHICHU", OleDbType.VarWChar)
cmd.Parameters.Add("@IDGIAOVIEN", OleDbType.Integer)
cmd.Parameters("@MAGIAOVIEN").Value = dto.MAGIAOVIEN
cmd.Parameters("@TENGIAOVIEN").Value = dto.TENGIAOVIEN
cmd.Parameters("@GIOITINH").Value = dto.GIOITINH
cmd.Parameters("@DIACHI").Value = dto.DIACHI
cmd.Parameters("@SDT").Value = dto.SDT
cmd.Parameters("@NGAYSINH").Value = dto.NGAYSINH
cmd.Parameters("@TRANGTHAI").Value = dto.TRANGTHAI
cmd.Parameters("@GHICHU").Value = dto.GHICHU
cmd.Parameters("@IDGIAOVIEN").Value = dto.IDGIAOVIEN
 cmd.ExecuteNonQuery()
 Case Class_KieuDL.Sql,Class_KieuDL.sqlExpress 
 strSQL = "Update GIAOVIEN Set MAGIAOVIEN= @MAGIAOVIEN , TENGIAOVIEN= @TENGIAOVIEN , GIOITINH= @GIOITINH , DIACHI= @DIACHI , SDT= @SDT , NGAYSINH= @NGAYSINH , TRANGTHAI= @TRANGTHAI , GHICHU= @GHICHU where IDGIAOVIEN= @IDGIAOVIEN"
 Dim cmd As New sqlCommand(strSQL, Ket_noi_sql)
cmd.Parameters.Add("@MAGIAOVIEN", SqlDbType.NVarChar)
cmd.Parameters.Add("@TENGIAOVIEN", SqlDbType.NVarChar)
cmd.Parameters.Add("@GIOITINH", SqlDbType.Int)
cmd.Parameters.Add("@DIACHI", SqlDbType.NVarChar)
cmd.Parameters.Add("@SDT", SqlDbType.NVarChar)
cmd.Parameters.Add("@NGAYSINH", SqlDbType.NVarChar)
cmd.Parameters.Add("@TRANGTHAI", SqlDbType.Int)
cmd.Parameters.Add("@GHICHU", SqlDbType.NVarChar)
cmd.Parameters.Add("@IDGIAOVIEN", SqlDbType.Int)
cmd.Parameters("@MAGIAOVIEN").Value = dto.MAGIAOVIEN
cmd.Parameters("@TENGIAOVIEN").Value = dto.TENGIAOVIEN
cmd.Parameters("@GIOITINH").Value = dto.GIOITINH
cmd.Parameters("@DIACHI").Value = dto.DIACHI
cmd.Parameters("@SDT").Value = dto.SDT
cmd.Parameters("@NGAYSINH").Value = dto.NGAYSINH
cmd.Parameters("@TRANGTHAI").Value = dto.TRANGTHAI
cmd.Parameters("@GHICHU").Value = dto.GHICHU
cmd.Parameters("@IDGIAOVIEN").Value = dto.IDGIAOVIEN
 cmd.ExecuteNonQuery()
 Case Class_KieuDL.SqlCe
 strSQL = "Update GIAOVIEN Set MAGIAOVIEN= @MAGIAOVIEN , TENGIAOVIEN= @TENGIAOVIEN , GIOITINH= @GIOITINH , DIACHI= @DIACHI , SDT= @SDT , NGAYSINH= @NGAYSINH , TRANGTHAI= @TRANGTHAI , GHICHU= @GHICHU where IDGIAOVIEN= @IDGIAOVIEN"
 Dim cmd As New SqlCeCommand(strSQL, Ket_noi_SqlCe)
cmd.Parameters("@MAGIAOVIEN").Value = dto.MAGIAOVIEN
cmd.Parameters("@TENGIAOVIEN").Value = dto.TENGIAOVIEN
cmd.Parameters("@GIOITINH").Value = dto.GIOITINH
cmd.Parameters("@DIACHI").Value = dto.DIACHI
cmd.Parameters("@SDT").Value = dto.SDT
cmd.Parameters("@NGAYSINH").Value = dto.NGAYSINH
cmd.Parameters("@TRANGTHAI").Value = dto.TRANGTHAI
cmd.Parameters("@GHICHU").Value = dto.GHICHU
cmd.Parameters("@IDGIAOVIEN").Value = dto.IDGIAOVIEN
 cmd.ExecuteNonQuery()
 Case Class_KieuDL.Oracle
 strSQL = "Update GIAOVIEN Set MAGIAOVIEN= @MAGIAOVIEN , TENGIAOVIEN= @TENGIAOVIEN , GIOITINH= @GIOITINH , DIACHI= @DIACHI , SDT= @SDT , NGAYSINH= @NGAYSINH , TRANGTHAI= @TRANGTHAI , GHICHU= @GHICHU where IDGIAOVIEN= @IDGIAOVIEN"
 Dim cmd As New OracleCommand(strSQL, Ket_noi_Oracle)
cmd.Parameters("@MAGIAOVIEN").Value = dto.MAGIAOVIEN
cmd.Parameters("@TENGIAOVIEN").Value = dto.TENGIAOVIEN
cmd.Parameters("@GIOITINH").Value = dto.GIOITINH
cmd.Parameters("@DIACHI").Value = dto.DIACHI
cmd.Parameters("@SDT").Value = dto.SDT
cmd.Parameters("@NGAYSINH").Value = dto.NGAYSINH
cmd.Parameters("@TRANGTHAI").Value = dto.TRANGTHAI
cmd.Parameters("@GHICHU").Value = dto.GHICHU
cmd.Parameters("@IDGIAOVIEN").Value = dto.IDGIAOVIEN
 cmd.ExecuteNonQuery()
 Case Class_KieuDL.MySql
 strSQL = "Update GIAOVIEN Set MAGIAOVIEN= @MAGIAOVIEN , TENGIAOVIEN= @TENGIAOVIEN , GIOITINH= @GIOITINH , DIACHI= @DIACHI , SDT= @SDT , NGAYSINH= @NGAYSINH , TRANGTHAI= @TRANGTHAI , GHICHU= @GHICHU where IDGIAOVIEN= @IDGIAOVIEN"
 Dim cmd As New MySqlCommand(strSQL, Ket_noi_MySql)
cmd.Parameters.Add("@MAGIAOVIEN", MySqlDbType.String)
cmd.Parameters.Add("@TENGIAOVIEN", MySqlDbType.String)
cmd.Parameters.Add("@GIOITINH", MySqlDbType.Int32)
cmd.Parameters.Add("@DIACHI", MySqlDbType.String)
cmd.Parameters.Add("@SDT", MySqlDbType.String)
cmd.Parameters.Add("@NGAYSINH", MySqlDbType.String)
cmd.Parameters.Add("@TRANGTHAI", MySqlDbType.Int32)
cmd.Parameters.Add("@GHICHU", MySqlDbType.String)
cmd.Parameters.Add("@IDGIAOVIEN", MySqlDbType.Int32)
cmd.Parameters("@MAGIAOVIEN").Value = dto.MAGIAOVIEN
cmd.Parameters("@TENGIAOVIEN").Value = dto.TENGIAOVIEN
cmd.Parameters("@GIOITINH").Value = dto.GIOITINH
cmd.Parameters("@DIACHI").Value = dto.DIACHI
cmd.Parameters("@SDT").Value = dto.SDT
cmd.Parameters("@NGAYSINH").Value = dto.NGAYSINH
cmd.Parameters("@TRANGTHAI").Value = dto.TRANGTHAI
cmd.Parameters("@GHICHU").Value = dto.GHICHU
cmd.Parameters("@IDGIAOVIEN").Value = dto.IDGIAOVIEN
 cmd.ExecuteNonQuery()
 End Select
 Ngatketnoi()
 End Sub
 Public Sub SuaMAGIAOVIEN( ByVal MAGIAOVIEN as System.String, ByVal IDGIAOVIEN As System.Int32 )
 Dim strSQL As String
 Moketnoi()
 select case ketnoi.MSsql 
 Case Class_KieuDL.Access
 strSQL = "Update GIAOVIEN Set MAGIAOVIEN = ?  where IDGIAOVIEN= ? "
 Dim cmd As New OleDbCommand(strSQL, Ket_noi_access)
 cmd.Parameters.Add("@MAGIAOVIEN", OleDbType.VarWChar)
 cmd.Parameters.Add("@IDGIAOVIEN", OleDbType.Integer)
 cmd.Parameters("@MAGIAOVIEN").Value =  MAGIAOVIEN
cmd.Parameters("@IDGIAOVIEN").Value =  IDGIAOVIEN
 cmd.ExecuteNonQuery()
 Case Class_KieuDL.Sql,Class_KieuDL.sqlExpress 
 strSQL = "Update GIAOVIEN Set MAGIAOVIEN = @MAGIAOVIEN  where IDGIAOVIEN= @IDGIAOVIEN"
 Dim cmd As New sqlCommand(strSQL, Ket_noi_sql)
 cmd.Parameters.Add("@MAGIAOVIEN", SqlDbType.NVarChar)
 cmd.Parameters.Add("@IDGIAOVIEN", SqlDbType.Int)
 cmd.Parameters("@MAGIAOVIEN").Value =  MAGIAOVIEN
cmd.Parameters("@IDGIAOVIEN").Value =  IDGIAOVIEN
 cmd.ExecuteNonQuery()
 Case Class_KieuDL.SqlCe
 strSQL = "Update GIAOVIEN Set MAGIAOVIEN =" & MAGIAOVIEN & "  where IDGIAOVIEN=" & IDGIAOVIEN & ""
 Dim cmd As New SqlCeCommand(strSQL, Ket_noi_SqlCe)
 cmd.ExecuteNonQuery()
 Case Class_KieuDL.Oracle
 strSQL = "Update GIAOVIEN Set MAGIAOVIEN =" & MAGIAOVIEN & "  where IDGIAOVIEN=" & IDGIAOVIEN & ""
 Dim cmd As New OracleCommand(strSQL, Ket_noi_Oracle)
 cmd.ExecuteNonQuery()
 Case Class_KieuDL.MySql
 strSQL = "Update GIAOVIEN Set MAGIAOVIEN =" & MAGIAOVIEN & "  where IDGIAOVIEN=" & IDGIAOVIEN & ""
 Dim cmd As New MySqlCommand(strSQL, Ket_noi_MySql)
 cmd.ExecuteNonQuery()
 End Select 
 Ngatketnoi()
 End Sub
 Public Sub SuaTENGIAOVIEN( ByVal TENGIAOVIEN as System.String, ByVal IDGIAOVIEN As System.Int32 )
 Dim strSQL As String
 Moketnoi()
 select case ketnoi.MSsql 
 Case Class_KieuDL.Access
 strSQL = "Update GIAOVIEN Set TENGIAOVIEN = ?  where IDGIAOVIEN= ? "
 Dim cmd As New OleDbCommand(strSQL, Ket_noi_access)
 cmd.Parameters.Add("@TENGIAOVIEN", OleDbType.VarWChar)
 cmd.Parameters.Add("@IDGIAOVIEN", OleDbType.Integer)
 cmd.Parameters("@TENGIAOVIEN").Value =  TENGIAOVIEN
cmd.Parameters("@IDGIAOVIEN").Value =  IDGIAOVIEN
 cmd.ExecuteNonQuery()
 Case Class_KieuDL.Sql,Class_KieuDL.sqlExpress 
 strSQL = "Update GIAOVIEN Set TENGIAOVIEN = @TENGIAOVIEN  where IDGIAOVIEN= @IDGIAOVIEN"
 Dim cmd As New sqlCommand(strSQL, Ket_noi_sql)
 cmd.Parameters.Add("@TENGIAOVIEN", SqlDbType.NVarChar)
 cmd.Parameters.Add("@IDGIAOVIEN", SqlDbType.Int)
 cmd.Parameters("@TENGIAOVIEN").Value =  TENGIAOVIEN
cmd.Parameters("@IDGIAOVIEN").Value =  IDGIAOVIEN
 cmd.ExecuteNonQuery()
 Case Class_KieuDL.SqlCe
 strSQL = "Update GIAOVIEN Set TENGIAOVIEN =" & TENGIAOVIEN & "  where IDGIAOVIEN=" & IDGIAOVIEN & ""
 Dim cmd As New SqlCeCommand(strSQL, Ket_noi_SqlCe)
 cmd.ExecuteNonQuery()
 Case Class_KieuDL.Oracle
 strSQL = "Update GIAOVIEN Set TENGIAOVIEN =" & TENGIAOVIEN & "  where IDGIAOVIEN=" & IDGIAOVIEN & ""
 Dim cmd As New OracleCommand(strSQL, Ket_noi_Oracle)
 cmd.ExecuteNonQuery()
 Case Class_KieuDL.MySql
 strSQL = "Update GIAOVIEN Set TENGIAOVIEN =" & TENGIAOVIEN & "  where IDGIAOVIEN=" & IDGIAOVIEN & ""
 Dim cmd As New MySqlCommand(strSQL, Ket_noi_MySql)
 cmd.ExecuteNonQuery()
 End Select 
 Ngatketnoi()
 End Sub
 Public Sub SuaGIOITINH( ByVal GIOITINH as System.Int32, ByVal IDGIAOVIEN As System.Int32 )
 Dim strSQL As String
 Moketnoi()
 select case ketnoi.MSsql 
 Case Class_KieuDL.Access
 strSQL = "Update GIAOVIEN Set GIOITINH = ?  where IDGIAOVIEN= ? "
 Dim cmd As New OleDbCommand(strSQL, Ket_noi_access)
 cmd.Parameters.Add("@GIOITINH", OleDbType.Integer)
 cmd.Parameters.Add("@IDGIAOVIEN", OleDbType.Integer)
 cmd.Parameters("@GIOITINH").Value =  GIOITINH
cmd.Parameters("@IDGIAOVIEN").Value =  IDGIAOVIEN
 cmd.ExecuteNonQuery()
 Case Class_KieuDL.Sql,Class_KieuDL.sqlExpress 
 strSQL = "Update GIAOVIEN Set GIOITINH = @GIOITINH  where IDGIAOVIEN= @IDGIAOVIEN"
 Dim cmd As New sqlCommand(strSQL, Ket_noi_sql)
 cmd.Parameters.Add("@GIOITINH", SqlDbType.Int)
 cmd.Parameters.Add("@IDGIAOVIEN", SqlDbType.Int)
 cmd.Parameters("@GIOITINH").Value =  GIOITINH
cmd.Parameters("@IDGIAOVIEN").Value =  IDGIAOVIEN
 cmd.ExecuteNonQuery()
 Case Class_KieuDL.SqlCe
 strSQL = "Update GIAOVIEN Set GIOITINH =" & GIOITINH & "  where IDGIAOVIEN=" & IDGIAOVIEN & ""
 Dim cmd As New SqlCeCommand(strSQL, Ket_noi_SqlCe)
 cmd.ExecuteNonQuery()
 Case Class_KieuDL.Oracle
 strSQL = "Update GIAOVIEN Set GIOITINH =" & GIOITINH & "  where IDGIAOVIEN=" & IDGIAOVIEN & ""
 Dim cmd As New OracleCommand(strSQL, Ket_noi_Oracle)
 cmd.ExecuteNonQuery()
 Case Class_KieuDL.MySql
 strSQL = "Update GIAOVIEN Set GIOITINH =" & GIOITINH & "  where IDGIAOVIEN=" & IDGIAOVIEN & ""
 Dim cmd As New MySqlCommand(strSQL, Ket_noi_MySql)
 cmd.ExecuteNonQuery()
 End Select 
 Ngatketnoi()
 End Sub
 Public Sub SuaDIACHI( ByVal DIACHI as System.String, ByVal IDGIAOVIEN As System.Int32 )
 Dim strSQL As String
 Moketnoi()
 select case ketnoi.MSsql 
 Case Class_KieuDL.Access
 strSQL = "Update GIAOVIEN Set DIACHI = ?  where IDGIAOVIEN= ? "
 Dim cmd As New OleDbCommand(strSQL, Ket_noi_access)
 cmd.Parameters.Add("@DIACHI", OleDbType.VarWChar)
 cmd.Parameters.Add("@IDGIAOVIEN", OleDbType.Integer)
 cmd.Parameters("@DIACHI").Value =  DIACHI
cmd.Parameters("@IDGIAOVIEN").Value =  IDGIAOVIEN
 cmd.ExecuteNonQuery()
 Case Class_KieuDL.Sql,Class_KieuDL.sqlExpress 
 strSQL = "Update GIAOVIEN Set DIACHI = @DIACHI  where IDGIAOVIEN= @IDGIAOVIEN"
 Dim cmd As New sqlCommand(strSQL, Ket_noi_sql)
 cmd.Parameters.Add("@DIACHI", SqlDbType.NVarChar)
 cmd.Parameters.Add("@IDGIAOVIEN", SqlDbType.Int)
 cmd.Parameters("@DIACHI").Value =  DIACHI
cmd.Parameters("@IDGIAOVIEN").Value =  IDGIAOVIEN
 cmd.ExecuteNonQuery()
 Case Class_KieuDL.SqlCe
 strSQL = "Update GIAOVIEN Set DIACHI =" & DIACHI & "  where IDGIAOVIEN=" & IDGIAOVIEN & ""
 Dim cmd As New SqlCeCommand(strSQL, Ket_noi_SqlCe)
 cmd.ExecuteNonQuery()
 Case Class_KieuDL.Oracle
 strSQL = "Update GIAOVIEN Set DIACHI =" & DIACHI & "  where IDGIAOVIEN=" & IDGIAOVIEN & ""
 Dim cmd As New OracleCommand(strSQL, Ket_noi_Oracle)
 cmd.ExecuteNonQuery()
 Case Class_KieuDL.MySql
 strSQL = "Update GIAOVIEN Set DIACHI =" & DIACHI & "  where IDGIAOVIEN=" & IDGIAOVIEN & ""
 Dim cmd As New MySqlCommand(strSQL, Ket_noi_MySql)
 cmd.ExecuteNonQuery()
 End Select 
 Ngatketnoi()
 End Sub
 Public Sub SuaSDT( ByVal SDT as System.String, ByVal IDGIAOVIEN As System.Int32 )
 Dim strSQL As String
 Moketnoi()
 select case ketnoi.MSsql 
 Case Class_KieuDL.Access
 strSQL = "Update GIAOVIEN Set SDT = ?  where IDGIAOVIEN= ? "
 Dim cmd As New OleDbCommand(strSQL, Ket_noi_access)
 cmd.Parameters.Add("@SDT", OleDbType.VarWChar)
 cmd.Parameters.Add("@IDGIAOVIEN", OleDbType.Integer)
 cmd.Parameters("@SDT").Value =  SDT
cmd.Parameters("@IDGIAOVIEN").Value =  IDGIAOVIEN
 cmd.ExecuteNonQuery()
 Case Class_KieuDL.Sql,Class_KieuDL.sqlExpress 
 strSQL = "Update GIAOVIEN Set SDT = @SDT  where IDGIAOVIEN= @IDGIAOVIEN"
 Dim cmd As New sqlCommand(strSQL, Ket_noi_sql)
 cmd.Parameters.Add("@SDT", SqlDbType.NVarChar)
 cmd.Parameters.Add("@IDGIAOVIEN", SqlDbType.Int)
 cmd.Parameters("@SDT").Value =  SDT
cmd.Parameters("@IDGIAOVIEN").Value =  IDGIAOVIEN
 cmd.ExecuteNonQuery()
 Case Class_KieuDL.SqlCe
 strSQL = "Update GIAOVIEN Set SDT =" & SDT & "  where IDGIAOVIEN=" & IDGIAOVIEN & ""
 Dim cmd As New SqlCeCommand(strSQL, Ket_noi_SqlCe)
 cmd.ExecuteNonQuery()
 Case Class_KieuDL.Oracle
 strSQL = "Update GIAOVIEN Set SDT =" & SDT & "  where IDGIAOVIEN=" & IDGIAOVIEN & ""
 Dim cmd As New OracleCommand(strSQL, Ket_noi_Oracle)
 cmd.ExecuteNonQuery()
 Case Class_KieuDL.MySql
 strSQL = "Update GIAOVIEN Set SDT =" & SDT & "  where IDGIAOVIEN=" & IDGIAOVIEN & ""
 Dim cmd As New MySqlCommand(strSQL, Ket_noi_MySql)
 cmd.ExecuteNonQuery()
 End Select 
 Ngatketnoi()
 End Sub
 Public Sub SuaNGAYSINH( ByVal NGAYSINH as System.String, ByVal IDGIAOVIEN As System.Int32 )
 Dim strSQL As String
 Moketnoi()
 select case ketnoi.MSsql 
 Case Class_KieuDL.Access
 strSQL = "Update GIAOVIEN Set NGAYSINH = ?  where IDGIAOVIEN= ? "
 Dim cmd As New OleDbCommand(strSQL, Ket_noi_access)
 cmd.Parameters.Add("@NGAYSINH", OleDbType.VarWChar)
 cmd.Parameters.Add("@IDGIAOVIEN", OleDbType.Integer)
 cmd.Parameters("@NGAYSINH").Value =  NGAYSINH
cmd.Parameters("@IDGIAOVIEN").Value =  IDGIAOVIEN
 cmd.ExecuteNonQuery()
 Case Class_KieuDL.Sql,Class_KieuDL.sqlExpress 
 strSQL = "Update GIAOVIEN Set NGAYSINH = @NGAYSINH  where IDGIAOVIEN= @IDGIAOVIEN"
 Dim cmd As New sqlCommand(strSQL, Ket_noi_sql)
 cmd.Parameters.Add("@NGAYSINH", SqlDbType.NVarChar)
 cmd.Parameters.Add("@IDGIAOVIEN", SqlDbType.Int)
 cmd.Parameters("@NGAYSINH").Value =  NGAYSINH
cmd.Parameters("@IDGIAOVIEN").Value =  IDGIAOVIEN
 cmd.ExecuteNonQuery()
 Case Class_KieuDL.SqlCe
 strSQL = "Update GIAOVIEN Set NGAYSINH =" & NGAYSINH & "  where IDGIAOVIEN=" & IDGIAOVIEN & ""
 Dim cmd As New SqlCeCommand(strSQL, Ket_noi_SqlCe)
 cmd.ExecuteNonQuery()
 Case Class_KieuDL.Oracle
 strSQL = "Update GIAOVIEN Set NGAYSINH =" & NGAYSINH & "  where IDGIAOVIEN=" & IDGIAOVIEN & ""
 Dim cmd As New OracleCommand(strSQL, Ket_noi_Oracle)
 cmd.ExecuteNonQuery()
 Case Class_KieuDL.MySql
 strSQL = "Update GIAOVIEN Set NGAYSINH =" & NGAYSINH & "  where IDGIAOVIEN=" & IDGIAOVIEN & ""
 Dim cmd As New MySqlCommand(strSQL, Ket_noi_MySql)
 cmd.ExecuteNonQuery()
 End Select 
 Ngatketnoi()
 End Sub
 Public Sub SuaTRANGTHAI( ByVal TRANGTHAI as System.Int32, ByVal IDGIAOVIEN As System.Int32 )
 Dim strSQL As String
 Moketnoi()
 select case ketnoi.MSsql 
 Case Class_KieuDL.Access
 strSQL = "Update GIAOVIEN Set TRANGTHAI = ?  where IDGIAOVIEN= ? "
 Dim cmd As New OleDbCommand(strSQL, Ket_noi_access)
 cmd.Parameters.Add("@TRANGTHAI", OleDbType.Integer)
 cmd.Parameters.Add("@IDGIAOVIEN", OleDbType.Integer)
 cmd.Parameters("@TRANGTHAI").Value =  TRANGTHAI
cmd.Parameters("@IDGIAOVIEN").Value =  IDGIAOVIEN
 cmd.ExecuteNonQuery()
 Case Class_KieuDL.Sql,Class_KieuDL.sqlExpress 
 strSQL = "Update GIAOVIEN Set TRANGTHAI = @TRANGTHAI  where IDGIAOVIEN= @IDGIAOVIEN"
 Dim cmd As New sqlCommand(strSQL, Ket_noi_sql)
 cmd.Parameters.Add("@TRANGTHAI", SqlDbType.Int)
 cmd.Parameters.Add("@IDGIAOVIEN", SqlDbType.Int)
 cmd.Parameters("@TRANGTHAI").Value =  TRANGTHAI
cmd.Parameters("@IDGIAOVIEN").Value =  IDGIAOVIEN
 cmd.ExecuteNonQuery()
 Case Class_KieuDL.SqlCe
 strSQL = "Update GIAOVIEN Set TRANGTHAI =" & TRANGTHAI & "  where IDGIAOVIEN=" & IDGIAOVIEN & ""
 Dim cmd As New SqlCeCommand(strSQL, Ket_noi_SqlCe)
 cmd.ExecuteNonQuery()
 Case Class_KieuDL.Oracle
 strSQL = "Update GIAOVIEN Set TRANGTHAI =" & TRANGTHAI & "  where IDGIAOVIEN=" & IDGIAOVIEN & ""
 Dim cmd As New OracleCommand(strSQL, Ket_noi_Oracle)
 cmd.ExecuteNonQuery()
 Case Class_KieuDL.MySql
 strSQL = "Update GIAOVIEN Set TRANGTHAI =" & TRANGTHAI & "  where IDGIAOVIEN=" & IDGIAOVIEN & ""
 Dim cmd As New MySqlCommand(strSQL, Ket_noi_MySql)
 cmd.ExecuteNonQuery()
 End Select 
 Ngatketnoi()
 End Sub
 Public Sub SuaGHICHU( ByVal GHICHU as System.String, ByVal IDGIAOVIEN As System.Int32 )
 Dim strSQL As String
 Moketnoi()
 select case ketnoi.MSsql 
 Case Class_KieuDL.Access
 strSQL = "Update GIAOVIEN Set GHICHU = ?  where IDGIAOVIEN= ? "
 Dim cmd As New OleDbCommand(strSQL, Ket_noi_access)
 cmd.Parameters.Add("@GHICHU", OleDbType.VarWChar)
 cmd.Parameters.Add("@IDGIAOVIEN", OleDbType.Integer)
 cmd.Parameters("@GHICHU").Value =  GHICHU
cmd.Parameters("@IDGIAOVIEN").Value =  IDGIAOVIEN
 cmd.ExecuteNonQuery()
 Case Class_KieuDL.Sql,Class_KieuDL.sqlExpress 
 strSQL = "Update GIAOVIEN Set GHICHU = @GHICHU  where IDGIAOVIEN= @IDGIAOVIEN"
 Dim cmd As New sqlCommand(strSQL, Ket_noi_sql)
 cmd.Parameters.Add("@GHICHU", SqlDbType.NVarChar)
 cmd.Parameters.Add("@IDGIAOVIEN", SqlDbType.Int)
 cmd.Parameters("@GHICHU").Value =  GHICHU
cmd.Parameters("@IDGIAOVIEN").Value =  IDGIAOVIEN
 cmd.ExecuteNonQuery()
 Case Class_KieuDL.SqlCe
 strSQL = "Update GIAOVIEN Set GHICHU =" & GHICHU & "  where IDGIAOVIEN=" & IDGIAOVIEN & ""
 Dim cmd As New SqlCeCommand(strSQL, Ket_noi_SqlCe)
 cmd.ExecuteNonQuery()
 Case Class_KieuDL.Oracle
 strSQL = "Update GIAOVIEN Set GHICHU =" & GHICHU & "  where IDGIAOVIEN=" & IDGIAOVIEN & ""
 Dim cmd As New OracleCommand(strSQL, Ket_noi_Oracle)
 cmd.ExecuteNonQuery()
 Case Class_KieuDL.MySql
 strSQL = "Update GIAOVIEN Set GHICHU =" & GHICHU & "  where IDGIAOVIEN=" & IDGIAOVIEN & ""
 Dim cmd As New MySqlCommand(strSQL, Ket_noi_MySql)
 cmd.ExecuteNonQuery()
 End Select 
 Ngatketnoi()
 End Sub
 Public Sub layBang()
 Chuoi_SQL = " Select * from GIAOVIEN
 Doc_bang()
 End Sub
 Public Sub layBangTheoIDGIAOVIEN(ByVal ARRAY1 As ArrayList)
 Dim DK As String = ""
 If ARRAY1.Count > 0 Then
 For I As Integer = 0 To ARRAY1.Count - 1
 DK = DK & IIf(DK <> "", " OR ", "") & "IDGIAOVIEN=" & ARRAY1.Item(i) & ""
 Next
 End If
 If DK <> "" Then DK = " WHERE " & DK 
 Chuoi_SQL = " Select * from GIAOVIEN" & DK
 Doc_bang()
 End Sub
 Public Sub layBangTheoIDGIAOVIEN(ByVal IDGIAOVIEN As System.Int32 )
 Chuoi_SQL = " Select * from GIAOVIEN where  IDGIAOVIEN = " & IDGIAOVIEN & ""
 Doc_bang()
 End Sub
 Public Sub XOABangTheoIDGIAOVIEN(ByVal IDGIAOVIEN As System.Int32)
 Dim strsql As String
 strSQL = "Delete From GIAOVIEN Where IDGIAOVIEN=" & IDGIAOVIEN & ""
 Thuc_hien_lenh(strsql)
 End Sub
 Public Sub layBangTheoMAGIAOVIEN(ByVal ARRAY1 As ArrayList)
 Dim DK As String = ""
 If ARRAY1.Count > 0 Then
 For I As Integer = 0 To ARRAY1.Count - 1
 DK = DK & IIf(DK <> "", " OR ", "") & "MAGIAOVIEN='" & ARRAY1.Item(i) & "'"
 Next
 End If
 If DK <> "" Then DK = " WHERE " & DK 
 Chuoi_SQL = " Select * from GIAOVIEN" & DK
 Doc_bang()
 End Sub
 Public Sub layBangTheoMAGIAOVIEN_like (ByVal MAGIAOVIEN As System.String )
 Chuoi_SQL = " Select * from GIAOVIEN where  MAGIAOVIEN  like '%" & MAGIAOVIEN & "%'"
 Doc_bang()
 End Sub
 Public Sub layBangTheoMAGIAOVIEN(ByVal MAGIAOVIEN As System.String )
 Chuoi_SQL = " Select * from GIAOVIEN where  MAGIAOVIEN = '" & MAGIAOVIEN & "'"
 Doc_bang()
 End Sub
 Public Sub XOABangTheoMAGIAOVIEN(ByVal MAGIAOVIEN As System.String)
 Dim strsql As String
 strSQL = "Delete From GIAOVIEN Where MAGIAOVIEN='" & MAGIAOVIEN & "'"
 Thuc_hien_lenh(strsql)
 End Sub
 Public Sub layBangTheoTENGIAOVIEN(ByVal ARRAY1 As ArrayList)
 Dim DK As String = ""
 If ARRAY1.Count > 0 Then
 For I As Integer = 0 To ARRAY1.Count - 1
 DK = DK & IIf(DK <> "", " OR ", "") & "TENGIAOVIEN='" & ARRAY1.Item(i) & "'"
 Next
 End If
 If DK <> "" Then DK = " WHERE " & DK 
 Chuoi_SQL = " Select * from GIAOVIEN" & DK
 Doc_bang()
 End Sub
 Public Sub layBangTheoTENGIAOVIEN_like (ByVal TENGIAOVIEN As System.String )
 Chuoi_SQL = " Select * from GIAOVIEN where  TENGIAOVIEN  like '%" & TENGIAOVIEN & "%'"
 Doc_bang()
 End Sub
 Public Sub layBangTheoTENGIAOVIEN(ByVal TENGIAOVIEN As System.String )
 Chuoi_SQL = " Select * from GIAOVIEN where  TENGIAOVIEN = '" & TENGIAOVIEN & "'"
 Doc_bang()
 End Sub
 Public Sub XOABangTheoTENGIAOVIEN(ByVal TENGIAOVIEN As System.String)
 Dim strsql As String
 strSQL = "Delete From GIAOVIEN Where TENGIAOVIEN='" & TENGIAOVIEN & "'"
 Thuc_hien_lenh(strsql)
 End Sub
 Public Sub layBangTheoGIOITINH(ByVal ARRAY1 As ArrayList)
 Dim DK As String = ""
 If ARRAY1.Count > 0 Then
 For I As Integer = 0 To ARRAY1.Count - 1
 DK = DK & IIf(DK <> "", " OR ", "") & "GIOITINH=" & ARRAY1.Item(i) & ""
 Next
 End If
 If DK <> "" Then DK = " WHERE " & DK 
 Chuoi_SQL = " Select * from GIAOVIEN" & DK
 Doc_bang()
 End Sub
 Public Sub layBangTheoGIOITINH(ByVal GIOITINH As System.Int32 )
 Chuoi_SQL = " Select * from GIAOVIEN where  GIOITINH = " & GIOITINH & ""
 Doc_bang()
 End Sub
 Public Sub XOABangTheoGIOITINH(ByVal GIOITINH As System.Int32)
 Dim strsql As String
 strSQL = "Delete From GIAOVIEN Where GIOITINH=" & GIOITINH & ""
 Thuc_hien_lenh(strsql)
 End Sub
 Public Sub layBangTheoDIACHI(ByVal ARRAY1 As ArrayList)
 Dim DK As String = ""
 If ARRAY1.Count > 0 Then
 For I As Integer = 0 To ARRAY1.Count - 1
 DK = DK & IIf(DK <> "", " OR ", "") & "DIACHI='" & ARRAY1.Item(i) & "'"
 Next
 End If
 If DK <> "" Then DK = " WHERE " & DK 
 Chuoi_SQL = " Select * from GIAOVIEN" & DK
 Doc_bang()
 End Sub
 Public Sub layBangTheoDIACHI_like (ByVal DIACHI As System.String )
 Chuoi_SQL = " Select * from GIAOVIEN where  DIACHI  like '%" & DIACHI & "%'"
 Doc_bang()
 End Sub
 Public Sub layBangTheoDIACHI(ByVal DIACHI As System.String )
 Chuoi_SQL = " Select * from GIAOVIEN where  DIACHI = '" & DIACHI & "'"
 Doc_bang()
 End Sub
 Public Sub XOABangTheoDIACHI(ByVal DIACHI As System.String)
 Dim strsql As String
 strSQL = "Delete From GIAOVIEN Where DIACHI='" & DIACHI & "'"
 Thuc_hien_lenh(strsql)
 End Sub
 Public Sub layBangTheoSDT(ByVal ARRAY1 As ArrayList)
 Dim DK As String = ""
 If ARRAY1.Count > 0 Then
 For I As Integer = 0 To ARRAY1.Count - 1
 DK = DK & IIf(DK <> "", " OR ", "") & "SDT='" & ARRAY1.Item(i) & "'"
 Next
 End If
 If DK <> "" Then DK = " WHERE " & DK 
 Chuoi_SQL = " Select * from GIAOVIEN" & DK
 Doc_bang()
 End Sub
 Public Sub layBangTheoSDT_like (ByVal SDT As System.String )
 Chuoi_SQL = " Select * from GIAOVIEN where  SDT  like '%" & SDT & "%'"
 Doc_bang()
 End Sub
 Public Sub layBangTheoSDT(ByVal SDT As System.String )
 Chuoi_SQL = " Select * from GIAOVIEN where  SDT = '" & SDT & "'"
 Doc_bang()
 End Sub
 Public Sub XOABangTheoSDT(ByVal SDT As System.String)
 Dim strsql As String
 strSQL = "Delete From GIAOVIEN Where SDT='" & SDT & "'"
 Thuc_hien_lenh(strsql)
 End Sub
 Public Sub layBangTheoNGAYSINH(ByVal ARRAY1 As ArrayList)
 Dim DK As String = ""
 If ARRAY1.Count > 0 Then
 For I As Integer = 0 To ARRAY1.Count - 1
 DK = DK & IIf(DK <> "", " OR ", "") & "NGAYSINH='" & ARRAY1.Item(i) & "'"
 Next
 End If
 If DK <> "" Then DK = " WHERE " & DK 
 Chuoi_SQL = " Select * from GIAOVIEN" & DK
 Doc_bang()
 End Sub
 Public Sub layBangTheoNGAYSINH_like (ByVal NGAYSINH As System.String )
 Chuoi_SQL = " Select * from GIAOVIEN where  NGAYSINH  like '%" & NGAYSINH & "%'"
 Doc_bang()
 End Sub
 Public Sub layBangTheoNGAYSINH(ByVal NGAYSINH As System.String )
 Chuoi_SQL = " Select * from GIAOVIEN where  NGAYSINH = '" & NGAYSINH & "'"
 Doc_bang()
 End Sub
 Public Sub XOABangTheoNGAYSINH(ByVal NGAYSINH As System.String)
 Dim strsql As String
 strSQL = "Delete From GIAOVIEN Where NGAYSINH='" & NGAYSINH & "'"
 Thuc_hien_lenh(strsql)
 End Sub
 Public Sub layBangTheoTRANGTHAI(ByVal ARRAY1 As ArrayList)
 Dim DK As String = ""
 If ARRAY1.Count > 0 Then
 For I As Integer = 0 To ARRAY1.Count - 1
 DK = DK & IIf(DK <> "", " OR ", "") & "TRANGTHAI=" & ARRAY1.Item(i) & ""
 Next
 End If
 If DK <> "" Then DK = " WHERE " & DK 
 Chuoi_SQL = " Select * from GIAOVIEN" & DK
 Doc_bang()
 End Sub
 Public Sub layBangTheoTRANGTHAI(ByVal TRANGTHAI As System.Int32 )
 Chuoi_SQL = " Select * from GIAOVIEN where  TRANGTHAI = " & TRANGTHAI & ""
 Doc_bang()
 End Sub
 Public Sub XOABangTheoTRANGTHAI(ByVal TRANGTHAI As System.Int32)
 Dim strsql As String
 strSQL = "Delete From GIAOVIEN Where TRANGTHAI=" & TRANGTHAI & ""
 Thuc_hien_lenh(strsql)
 End Sub
 Public Sub layBangTheoGHICHU(ByVal ARRAY1 As ArrayList)
 Dim DK As String = ""
 If ARRAY1.Count > 0 Then
 For I As Integer = 0 To ARRAY1.Count - 1
 DK = DK & IIf(DK <> "", " OR ", "") & "GHICHU='" & ARRAY1.Item(i) & "'"
 Next
 End If
 If DK <> "" Then DK = " WHERE " & DK 
 Chuoi_SQL = " Select * from GIAOVIEN" & DK
 Doc_bang()
 End Sub
 Public Sub layBangTheoGHICHU_like (ByVal GHICHU As System.String )
 Chuoi_SQL = " Select * from GIAOVIEN where  GHICHU  like '%" & GHICHU & "%'"
 Doc_bang()
 End Sub
 Public Sub layBangTheoGHICHU(ByVal GHICHU As System.String )
 Chuoi_SQL = " Select * from GIAOVIEN where  GHICHU = '" & GHICHU & "'"
 Doc_bang()
 End Sub
 Public Sub XOABangTheoGHICHU(ByVal GHICHU As System.String)
 Dim strsql As String
 strSQL = "Delete From GIAOVIEN Where GHICHU='" & GHICHU & "'"
 Thuc_hien_lenh(strsql)
 End Sub
 Public Sub layBangNhieuTable
 Chuoi_SQL = " Select IDGIAOVIEN ,MAGIAOVIEN ,TENGIAOVIEN ,GIOITINH ,DIACHI ,SDT ,NGAYSINH ,TRANGTHAI ,GHICHU  from GIAOVIEN"
 Doc_bang()
 End sub
Public Sub TaoTable()
Dim strsql As String
strsql = ""
Select Case ketnoi.MsSql
Case Class_KieuDL.Access 
Case Class_KieuDL.Sql, Class_KieuDL.sqlExpress
strsql = ""
Case Class_KieuDL.SqlCe
strsql = ""
Case Class_KieuDL.Oracle
strsql = ""
Case else 
strsql = ""
End Select
Thuc_hien_lenh(strsql)
End Sub
 End Class

